home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vblha1 / getfile.frm < prev    next >
Text File  |  1995-12-05  |  13KB  |  579 lines

  1. VERSION 2.00
  2. Begin Form frmGetFile 
  3.    AutoRedraw      =   -1  'True
  4.    Caption         =   "Select a file"
  5.    ClientHeight    =   4170
  6.    ClientLeft      =   1530
  7.    ClientTop       =   1500
  8.    ClientWidth     =   6360
  9.    Height          =   4575
  10.    Left            =   1470
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4170
  13.    ScaleWidth      =   6360
  14.    Top             =   1155
  15.    Width           =   6480
  16.    Begin PictureBox picLZHenter 
  17.       Height          =   615
  18.       Left            =   6840
  19.       Picture         =   GETFILE.FRX:0000
  20.       ScaleHeight     =   585
  21.       ScaleWidth      =   465
  22.       TabIndex        =   21
  23.       Top             =   3120
  24.       Width           =   495
  25.    End
  26.    Begin PictureBox picLZH 
  27.       BorderStyle     =   0  'None
  28.       Height          =   495
  29.       Left            =   5160
  30.       ScaleHeight     =   495
  31.       ScaleWidth      =   495
  32.       TabIndex        =   19
  33.       Top             =   3600
  34.       Width           =   495
  35.    End
  36.    Begin PictureBox picLZHopen 
  37.       Height          =   615
  38.       Left            =   6840
  39.       Picture         =   GETFILE.FRX:0302
  40.       ScaleHeight     =   585
  41.       ScaleWidth      =   465
  42.       TabIndex        =   18
  43.       Top             =   2400
  44.       Width           =   495
  45.    End
  46.    Begin PictureBox picLZHClose 
  47.       Height          =   615
  48.       Left            =   6840
  49.       Picture         =   GETFILE.FRX:0604
  50.       ScaleHeight     =   585
  51.       ScaleWidth      =   465
  52.       TabIndex        =   17
  53.       Top             =   1560
  54.       Width           =   495
  55.    End
  56.    Begin TextBox txtLZHname 
  57.       Height          =   375
  58.       Left            =   5040
  59.       TabIndex        =   16
  60.       Top             =   3120
  61.       Width           =   1215
  62.    End
  63.    Begin CommandButton btnTrash 
  64.       Caption         =   "&Trash"
  65.       Height          =   495
  66.       Left            =   5160
  67.       TabIndex        =   15
  68.       Top             =   2160
  69.       Width           =   1095
  70.    End
  71.    Begin PictureBox picFile2 
  72.       Height          =   615
  73.       Left            =   6960
  74.       Picture         =   GETFILE.FRX:0906
  75.       ScaleHeight     =   585
  76.       ScaleWidth      =   465
  77.       TabIndex        =   14
  78.       Top             =   840
  79.       Width           =   495
  80.    End
  81.    Begin PictureBox PicFile1 
  82.       Height          =   615
  83.       Left            =   6960
  84.       Picture         =   GETFILE.FRX:0C08
  85.       ScaleHeight     =   585
  86.       ScaleWidth      =   465
  87.       TabIndex        =   13
  88.       Top             =   120
  89.       Width           =   495
  90.    End
  91.    Begin CommandButton cmdDelete 
  92.       Caption         =   "&Delete"
  93.       Height          =   495
  94.       Left            =   5160
  95.       TabIndex        =   12
  96.       Top             =   1560
  97.       Width           =   1095
  98.    End
  99.    Begin CommandButton cmdCancel 
  100.       Cancel          =   -1  'True
  101.       Caption         =   "&Cancel"
  102.       Height          =   495
  103.       Left            =   5160
  104.       TabIndex        =   11
  105.       Top             =   720
  106.       Width           =   1095
  107.    End
  108.    Begin CommandButton cmdOK 
  109.       Caption         =   "&OK"
  110.       Height          =   495
  111.       Left            =   5160
  112.       TabIndex        =   10
  113.       Top             =   120
  114.       Width           =   1095
  115.    End
  116.    Begin DirListBox dirDirectory 
  117.       Height          =   2280
  118.       Left            =   2640
  119.       TabIndex        =   9
  120.       Top             =   720
  121.       Width           =   2295
  122.    End
  123.    Begin DriveListBox drvDrive 
  124.       Height          =   315
  125.       Left            =   2640
  126.       TabIndex        =   5
  127.       Top             =   3600
  128.       Width           =   2295
  129.    End
  130.    Begin ComboBox cboFileType 
  131.       Height          =   300
  132.       Left            =   240
  133.       Style           =   2  'Dropdown List
  134.       TabIndex        =   4
  135.       Top             =   3600
  136.       Width           =   2175
  137.    End
  138.    Begin FileListBox filFiles 
  139.       Height          =   2370
  140.       Hidden          =   -1  'True
  141.       Left            =   240
  142.       TabIndex        =   2
  143.       Top             =   720
  144.       Width           =   2175
  145.    End
  146.    Begin TextBox txtFileName 
  147.       Height          =   285
  148.       Left            =   240
  149.       TabIndex        =   1
  150.       Top             =   360
  151.       Width           =   2175
  152.    End
  153.    Begin Label lblLZH 
  154.       Caption         =   "LHA File Name"
  155.       Height          =   255
  156.       Left            =   5040
  157.       TabIndex        =   20
  158.       Top             =   2880
  159.       Width           =   1215
  160.    End
  161.    Begin Label lblDirName 
  162.       Height          =   255
  163.       Left            =   2640
  164.       TabIndex        =   8
  165.       Top             =   360
  166.       Width           =   1455
  167.    End
  168.    Begin Label lblDirectories 
  169.       Caption         =   "Directories:"
  170.       Height          =   255
  171.       Left            =   2640
  172.       TabIndex        =   7
  173.       Top             =   120
  174.       Width           =   975
  175.    End
  176.    Begin Label lbDrive 
  177.       Caption         =   "Drive:"
  178.       Height          =   255
  179.       Left            =   2640
  180.       TabIndex        =   6
  181.       Top             =   3360
  182.       Width           =   975
  183.    End
  184.    Begin Label lblFileType 
  185.       Caption         =   "File Type:"
  186.       Height          =   255
  187.       Left            =   240
  188.       TabIndex        =   3
  189.       Top             =   3360
  190.       Width           =   735
  191.    End
  192.    Begin Label lblFileName 
  193.       Caption         =   "File Name:"
  194.       Height          =   255
  195.       Left            =   240
  196.       TabIndex        =   0
  197.       Top             =   120
  198.       Width           =   855
  199.    End
  200. End
  201. Dim LZHstatus
  202. Dim LZHname
  203.  
  204. Sub btnexit_Click ()
  205.  End
  206. End Sub
  207.  
  208. Sub btnTrash_Click ()
  209.  
  210. Dim Filenum As Integer
  211. Dim Filesize As Integer
  212.  
  213. On Error GoTo JDELETE
  214.  
  215. If txtFileName.Text = "" Then
  216.   Exit Sub
  217. End If
  218.  
  219. 'Insert drive and path name
  220. procInsPath
  221.    
  222. 'Get a free file number
  223. Filenum = FreeFile
  224.  
  225. 'Get file size
  226. Filesize = FileLen(frmGetFile.Tag) - 2
  227.  
  228. If Filesize > 0 Then
  229. If Filesize > szbuff Then
  230.   Filesize = szbuff
  231.  End If
  232.  buffer = Space(Filesize)
  233.  
  234.  'Open file
  235.  Open frmGetFile.Tag For Output As Filenum
  236.  
  237.  'Output spaces to file
  238.  Print #Filenum, buffer
  239.  
  240.  'Close file
  241.  Close Filenum
  242. End If
  243.  
  244. JDELETE:
  245. 'Delete file
  246. Kill frmGetFile.Tag
  247. txtFileName.Text = ""
  248.  
  249. 'Update file list
  250. filFiles.Refresh
  251.  
  252. Exit Sub
  253.  
  254. End Sub
  255.  
  256. Sub btnTrash_DragDrop (Source As Control, X As Single, Y As Single)
  257.  
  258. btnTrash_Click
  259.  
  260. End Sub
  261.  
  262. Sub btnTrash_DragOver (Source As Control, X As Single, Y As Single, State As Integer)
  263.  
  264. Select Case State
  265.   Case 0
  266.     'change icon to release
  267.      filFiles.DragIcon = picFile2
  268.   Case 1
  269.     'change icon to release
  270.      filFiles.DragIcon = picFile1
  271. End Select
  272.  
  273. End Sub
  274.  
  275. Sub cboFileType_Click ()
  276.  
  277. Dim patternpos1 As Integer
  278. Dim patternpos2 As Integer
  279. Dim patternlen As Integer
  280. Dim Pattern As String
  281.  
  282. 'Find starting position
  283. patternpos1 = InStr(1, cbofiletype.Text, "(") + 1
  284.  
  285. 'Find the end position
  286. patternpos2 = InStr(1, cbofiletype.Text, ")") - 1
  287.  
  288. 'Calculate the length of the pattern string
  289. patternlen = patternpos2 - patternpos1 + 1
  290.  
  291. 'Extract the pattern from the combo box
  292. Pattern = Mid$(cbofiletype.Text, patternpos1, patternlen)
  293.  
  294. 'set the pattern of the filfiles to the select pattern
  295. filFiles.Pattern = Pattern
  296.  
  297.  
  298. End Sub
  299.  
  300. Sub cmdCancel_Click ()
  301.  
  302. 'Set the frmgetfile.tag to null
  303. frmGetFile.Tag = ""
  304.  
  305. 'Hide the frmgetfile
  306. frmlha.Hide
  307. frmGetFile.Hide
  308.  
  309. End Sub
  310.  
  311. Sub cmdDelete_Click ()
  312.  
  313. If txtFileName.Text = "" Then
  314.   Exit Sub
  315. End If
  316.  
  317. 'Insert drive and path name
  318. procInsPath
  319.    
  320. 'Delete file
  321. Kill frmGetFile.Tag
  322. txtFileName.Text = ""
  323.  
  324. 'Update file list
  325. filFiles.Refresh
  326.  
  327. End Sub
  328.  
  329. Sub cmdDelete_DragDrop (Source As Control, X As Single, Y As Single)
  330.  
  331. cmdDelete_Click
  332.  
  333. End Sub
  334.  
  335. Sub cmdDelete_DragOver (Source As Control, X As Single, Y As Single, State As Integer)
  336.  
  337. Select Case State
  338.   Case 0
  339.     'change icon to release
  340.      filFiles.D